package com.heima.admin.controller.v1;

import com.heima.admin.service.AdUserService;
import com.heima.apis.admin.LoginControllerApi;
import com.heima.model.admin.dtos.AdUserDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Version: V1.0
 */
@RestController
@RequestMapping("/login")
public class LoginController implements LoginControllerApi {


    @Autowired
    AdUserService adUserService;

    /**
     * 用户登录
     *
     * @param dto
     * @return
     */
    @PostMapping("/in")
    @Override
    public ResponseResult login(@RequestBody @Validated AdUserDto dto) {
        return adUserService.login(dto);
    }
}
